
<div class="jumbotron">

	<div id="main">
            <div class="novelslist2">
                <h2> 临时书架 - （注册用户浏览过的小说会自动保存到书架中，永久保存）</h2>
                <ul class="book-shelf-cookie">
                    <li>
                    	<span class="s1"><b>序号</b></span>
                    	<span class="s2"><b>小说名称</b></span>
                    	<span class="s4"><b>作者</b></span>
                    	<span class="s3"><b></b></span>
                    	<span class="s5"><b>上次阅读章节</b></span>
                        <span class="s6"><b>上次阅读时间</b></span>
                        <span class="s7" style="text-align:right;"><b>操作</b></span>
                    </li>




                </ul>
            </div>
            <div class="clear">
            </div>
        </div>


	<script src="/Public/location/Script/jquery.cookie.js" ></script>
	<script src="/Public/location/Script/content.js" ></script>

	<script>
	$(function(){
			//readlogs = $.cookie('readlogs');
			books = $.cookie('readbook');
			books = books.replace(/(^:)|(:$)/g,"");
			books = books.split(':');
			//books = books.split(',');


			for(var i=0;i<100;i++){
				if(books[i] == undefined){
					break;
				}
				//alert(books[i]);
				readlog = $.cookie('readlog_'+books[i]);
				//console.log(readlog);
				if(readlog == null || readlog == ''){
					continue;
				}
				readlog = readlog.split(':');
				html = '';
				html += '<li class="cookie-readlog_'+books[i]+'"><span class="s1">'+(i+1)+'</span>';
				html += '<span class="s2"><a href="/'+readlog[0]+'.html" target="_blank">'+readlog[1]+'</a></span>';
				html += '<span class="s4">'+readlog[2]+'</span>';
				html += '<span class="s3"><a style="color: Red;" href="/'+readlog[0]+'-'+readlog[3]+'.html" target="_blank" title="'+readlog[4]+'">'+readlog[4]+'</a></span>';
				html += '<span class="s6">'+readlog[5]+'</span>';
				html += '<span class="s7"><a onclick="clearCookies(\'readlog_'+books[i]+'\')" href="#"><font color="#ff0000">删除</font></a> </span></li>';
				//alert(books[i]);
				$('.book-shelf-cookie').append(html);
			}

			console.log($.cookie());
	});

	function clearCookies(name = null){
		if(name != null){
			$.cookie(name,null,{path:'/'});
			$('.cookie-'+name).remove();
			swal({
               title:"删除成功!",
               text:"",
               type:"success"
            });
		}
	}
	</script>
</div>
